﻿using AppHelper;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            //启动加载等待
            //StartingWindow startingWindow = new StartingWindow("应用程序名称","公司名称");
            StartingWindow startingWindow = new StartingWindow("AppDemo", "dhsososo@163.com");
            startingWindow.loadingHandler += () =>
            {
                //做要加载的动作
                startingWindow.SetTips("等待中1");
                Thread.Sleep(2000);
                startingWindow.SetTips("等待中2");
                Thread.Sleep(2000);
                startingWindow.SetTips("等待中3");
                Thread.Sleep(2000);
            };
            startingWindow.exitHandler += () =>
            {
                //点击退出时 做要退出加载的动作
                startingWindow.SetTips("退出加载1");
                Thread.Sleep(2000);
                startingWindow.SetTips("退出加载2");
                Thread.Sleep(2000);
                startingWindow.SetTips("退出加载3");
                Thread.Sleep(2000); 
                
            };

            //
            startingWindow.ShowDialog();
        }
    }
}
